//
//  RootViewController.m
//  BigTyre
//
//  Created by 田涛 on 2017/3/15.
//  Copyright © 2017年 Lemon. All rights reserved.
//

#import "RootViewController.h"
#import "HomeViewController.h"
#import "SelectTyreViewController.h"
#import "FindViewController.h"
#import "MyViewController.h"

@interface RootViewController ()

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initViewControllers];
}

- (void)initViewControllers {
    
    HomeViewController *homeVc = [[HomeViewController alloc] init];
    homeVc.title = @"首页";
    homeVc.tabBarItem.image = [[UIImage imageNamed:@"root_home_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    homeVc.tabBarItem.selectedImage = [[UIImage imageNamed:@"root_home_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    SelectTyreViewController *selectTyreVc = [[SelectTyreViewController alloc] init];
    selectTyreVc.title = @"选胎";
    selectTyreVc.tabBarItem.image = [[UIImage imageNamed:@"root_tyre_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    selectTyreVc.tabBarItem.selectedImage = [[UIImage imageNamed:@"root_tyre_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    FindViewController *findVc = [[FindViewController alloc] init];
    findVc.title = @"商铺";
    findVc.tabBarItem.image = [[UIImage imageNamed:@"root_store_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    findVc.tabBarItem.selectedImage = [[UIImage imageNamed:@"root_store_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    MyViewController *myVc = [[MyViewController alloc] init];
    myVc.title = @"我的";
    myVc.tabBarItem.image = [[UIImage imageNamed:@"root_my_normal"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    myVc.tabBarItem.selectedImage = [[UIImage imageNamed:@"root_my_select"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    
    UINavigationController *homeNc = [[UINavigationController alloc] initWithRootViewController:homeVc];
    UINavigationController *selectTyreNc = [[UINavigationController alloc] initWithRootViewController:selectTyreVc];
    UINavigationController *findNc = [[UINavigationController alloc] initWithRootViewController:findVc];
    UINavigationController *myNc = [[UINavigationController alloc] initWithRootViewController:myVc];
    homeNc.navigationBar.translucent = NO;
    selectTyreNc.navigationBar.translucent = NO;
    findNc.navigationBar.translucent = NO;
    myNc.navigationBar.translucent = NO;

    self.viewControllers = @[homeNc,selectTyreNc,findNc,myNc];
    self.tabBar.tintColor = [UIColor colorWithRed:(226/255.0) green:(124/255.0) blue:(42/255.0) alpha:1];
    self.tabBar.translucent= NO;
}






@end
